//app.js
let config = require("./config/config.js"); //封装的request请求

App({
  onLaunch: function () {
    let systemInfo = wx.getSystemInfoSync()
    let menuButton = wx.getMenuButtonBoundingClientRect()
    let paddingTop = systemInfo.statusBarHeight + (menuButton.height + (menuButton.top - systemInfo.statusBarHeight) * 2)
    let screenHeight = systemInfo.screenHeight
    let pageAllHeight = screenHeight * 2 - paddingTop * 2
    this.globalData.pageAllHeight = pageAllHeight
    wx.removeStorageSync('lmtc_start')
  },
  onHide() {
    wx.removeStorageSync('lmtc_start')
  },
  globalData: {
    userInfo: wx.getStorageSync('lmtc_userInfo'),
    statusBarHeight: wx.getSystemInfoSync()['statusBarHeight'],
    screenHeight: wx.getSystemInfoSync()['screenHeight'],
    websocketUrl: config.webscoket_url,
    pageAllHeight: 0
  }
})